#pragma once

#include <memory>

#include "graph.hh"
#include "../meta/constraints.hh"

namespace icesp
{
    namespace graph
    {
        struct adj_matrix;
    }

    struct painter : meta::non_transferable
    {
        painter();
        ~painter();

        int bfs_delta_depth_coloring(graph::adj_matrix& g, int source, int delta_depth);
        void refine(int nthread);
        void from_array(int len, int* colors);

        int const* get_colors()            const;
        int const* get_label()             const;
        int const* get_unlabel()           const;
        int const* get_node_number_count() const;

        int n;
        int nthread;
        int* colors;
        int* node_number_count;
        int* label;
        int* unlabel;

    private:
        void release();
        void release_and_allocate();
        void release_node_number_count();
    };
}

